#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#define N 10

void select_sort(int arr[], int n);

int main()
{
	int arr[N];
	int i;

	printf("Please enter arr:\n");
	for (i = 0; i < N; i++)
		scanf("%d", &arr[i]);

	select_sort(arr, N);

	for (i = 0; i < N; i++)
		printf("%d ", arr[i]);

	return 0;
}

void select_sort(int arr[], int n)
{
	int i, j, t;
	int imax;

	
	for (i = 0; i < N-1; i++)
	{
		imax=i;
		for (j = 1 + i; j < N ; j++)
			if (arr[j] > arr[imax])
				imax=j;
		if (imax != i)
		{
			t = arr[imax];
			arr[imax] = arr[i];
			arr[i] = t;
		}

	}

}